home *** CD-ROM | disk | FTP | other *** search
/ Invisible Universe / Invisible Universe (1995)(Voyager)[Mac-PC].iso / mac / MOVIES / MUSIC.DIR / 00001_Script_1 next >
Text File  |  1995-11-16  |  4KB  |  138 lines

  1. on startMovie
  2.   --set the keyDownScript to "checkKeyDowns"
  3.   initialize
  4.   pass
  5. end startMovie
  6.  
  7. on keyDown
  8. end
  9.  
  10. on exitFrame
  11.   go to the frame
  12. end exitFrame
  13.  
  14. on enterFrame
  15.   
  16. end enterFrame
  17.  
  18. on stopMovie
  19.   go frame "FadeOut"
  20.   set the mouseDownScript to ""
  21.   unload
  22.   abort
  23.   pass
  24. end stopMovie
  25.  
  26. on initialize
  27.   global gTheSongs, gMusicIsPlaying, gMusicCastNumber, gWhichSong, gLastMusicCastNumber
  28.   global gMusicDuration, gThePicts,gCurrentPictNum, gMusicLabel
  29.   global gQuittingMusic
  30.   
  31.   set gQuittingMusic = 0
  32.   
  33.   set the mouseDownScript to "QuitAndGoBack"
  34.   
  35.   if voidP(gMusicLabel) then 
  36.     put "COMETS" into gTheSongs
  37.   else
  38.     put gMusicLabel into gTheSongs
  39.   end if
  40.   set gThePicts to []
  41.   --put randomPicts() into gThePicts
  42.   put 0 into gWhichSong
  43.   put 0 into gLastMusicCastNumber
  44.   put 0 into gMusicCastNumber
  45.   put 0 into gMusicDuration
  46.   put 0 into gRandomGuy
  47.   put false into gMusicIsPlaying
  48.   put 1 into gCurrentPictNum
  49. end initialize
  50.  
  51. on startMusic
  52.   global gTheSongs, gMusicIsPlaying, gMusicCastNumber,gWhichSong, gLastMusicCastNumber
  53.   global gMusicDuration, gLastPictSwitch
  54.   
  55.   global gFixPalShared
  56.   
  57.   if the machineType <> 256 then
  58.     if voidP(gFixPalShared) then setupFixPal
  59.     
  60.     gFixPalShared(mPatchIt)
  61.   end if
  62.   
  63.   
  64.   put gMusicCastNumber into gLastMusicCastNumber
  65.   if gLastMusicCastNumber <> 0 then
  66.     --set the purgePriority of cast gLastMusicCastNumber to 2 --purge next
  67.     unloadcast gLastMusicCastNumber
  68.   end if
  69.   put gWhichSong+1 into gWhichSong
  70.   --  if gWhichSong > (the number of items in gTheSongs) then put 1 into gWhichSong
  71.   if not listP(gTheSongs) then set gTheSongs = list(gTheSongs)
  72.   
  73.   if gWhichSong > (count(gTheSongs)) then put 1 into gWhichSong
  74.   put the number of cast (getAt(gTheSongs, gWhichSong) & ".MOV") into gMusicCastNumber
  75.   
  76.   put ">>> " & gTheSongs
  77.   put ">>> playing " & getAt(gTheSongs, gWhichSong) && gWhichSong
  78.   
  79.   puppetSprite 48,true
  80.   set the castNum of sprite 48 to gMusicCastNumber
  81.   --set the purgePriority of cast gMusicCastNumber to 0
  82.   put the duration of cast gMusicCastNumber into gMusicDuration
  83.   --set the directToStage of cast gMusicCastNumber to true
  84.   set the movieRate of sprite 48 to .01
  85.   --  go frame "start"
  86.   updateStage
  87.   startTimer
  88.   put 0 into gLastPictSwitch
  89.   set the movieRate of sprite 48 to 1
  90.   put true into gMusicIsPlaying
  91. end startMusic
  92.  
  93. on QuitAndGoBack
  94.   global gMusicCastNumber, gQuittingMusic, gTheSongs
  95.   
  96.   set gTheSongs = 0
  97.   
  98.   set gQuittingMusic = 1
  99.   
  100.   --set the purgePriority of cast gMusicCastNumber to 3
  101.   
  102.   set v = the volume of sprite 48
  103.   repeat while v > 0
  104.     set v = v / 2
  105.     set the volume of sprite 48 = v
  106.   end repeat
  107.   
  108.   --set the directToStage of cast gMusicCastNumber to false
  109.   set the movieRate of sprite 48 to 0
  110.   puppetSprite 48, 1
  111.   set the castNum of sprite 48 = 0
  112.   puppetSprite 48, 0
  113.   if the machineType = 256 then updateStage
  114.   
  115.   --  go to "Black Frame"
  116.   
  117.   --  go to the frame + 1
  118.   
  119.   retrace 1
  120.   --  go movie "TOC"
  121. end QuitAndGoBack
  122.  
  123. on randomPicts
  124.   return jumble(value(field "randomPicts"))
  125. end randomPicts
  126.  
  127. on jumble oldList
  128.   set newList to []
  129.   set the randomSeed to integer(the last char of string(the ticks))
  130.   put count(oldList) into toChooseFrom
  131.   repeat while toChooseFrom
  132.     put random(toChooseFrom) into r
  133.     append newList, getAt(oldList,r)
  134.     deleteAt oldList,r
  135.     put count(oldList) into toChooseFrom
  136.   end repeat
  137.   return newList
  138. end jumble